package com.cc.factory;

public class BlackPig extends Pig{
    private int age;
    private String name;
    public BlackPig() {
        System.out.println("调用了BlackPig的构造方法");
    }
    public BlackPig(int ag, String nm) {
        this.age = ag;
        this.name = nm;
    }
    public BlackPig(String name) {
        this.name = name;
    }
    
    public BlackPig(String name, int age) {
        this.age = age;
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Override
    public String toString() {
        return "BlackPig [age=" + age + ", name=" + name + "]";
    }
    
}
